(define (factor^ divisor number)
    (if (> (* divisor divisor) number)
        (cons number '())
        (if (= (modulo number divisor) 0)
            (cons divisor (factor^ divisor (/ number divisor)))
            (factor^ (+ divisor 1) number))))

(define (factor number)
  (factor^ 2 number))
